<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <!--我的评价模块，分为待评价和已评价模块，
    1.待评价模块，待评价可以处理评价问题
    2.已评价模块可以追加内容，有内容则显示
    3.用户可以对评价内容进行评论
    5.我可以回复用户评论，或者选择不回复，看淘宝
    6.查看他人评论，筛选被评论的医生，根据星级筛选（差评、好评、。。。。）
    -->
    <!--涉及的：医生信息的查询与显示工作-->

    <!--预约表信息的处理问题，删除预约表问题-->
    <meta charset="UTF-8">
    <title>我的评价</title>
    <!--<link rel="stylesheet" href="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/css/bootstrap.min.css">-->
    <!--<script type="text/javascript" src="/js/jquery-3.4.1.js"></script>-->
    <!--<script src="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/js/bootstrap.min.js"></script>-->
    <link rel="stylesheet" href="/css/bootstrap.min.css" type="text/css" />
    <link rel="stylesheet" href="/css/milligram.min.css" type="text/css" />
    <link rel="stylesheet" href="/css/fonts.style.css" type="text/css" />
    <link rel="stylesheet" href="/css/style.css" type="text/css" />

    <script src="/js/jquery-3.4.1.js"></script>
    <script th:src="@{/js/jQueryCode.js}"></script>
    <script src="/js/bootstrap.min.js"></script>

    <!--<link rel="stylesheet" href="../../static/css/bootstrap.min.css" type="text/css" />-->
    <!--<link rel="stylesheet" href="../../static/css/milligram.min.css" type="text/css" />-->
    <!--<link rel="stylesheet" href="../../static/css/fonts.style.css" type="text/css" />-->
    <!--<link rel="stylesheet" href="../../static/css/style.css" type="text/css" />-->

    <!--<script src="../../static/js/jquery-3.4.1.js"></script>-->
    <!--<script src="../../static/js/jQueryCode.js"></script>-->
    <!--<script src="../../static/js/bootstrap.min.js"></script>-->

    <style type="text/css">

        /*处理星星显示问题*/
        .star_list{
            width: 100px;
        }

        .star_list a{
            font-size: 15px;
            text-decoration: none;
        }
    </style>

</head>
<!--利用js处理不同的数据内容：
1.控制我的评价的分页显示
2.控制追评与未追评
3.控制是否追评
4.标签的选择控制
5.不同页面的标签选择
-->
<body>
<div class="top-nav animation-bg-color-skyblue">
    <div class="logo">
        <a href="#"><img th:src="@{/img/logo.png}" /></a>
    </div>
    <div class="account-check fr">
        <div class="before-login">
            <a class="a-btn animation" href="/user/login">
                <span class="icon-enter"></span>登录
            </a>
            <a class="a-btn animation" href="/user/register">
                <span class="icon-user-plus"></span>注册
            </a>
        </div>
        <div class="after-login hide">
            <!--<a class="a-btn animation fr" href="#">-->
            <!--<span class="icon-exit"></span>退出-->
            <!--</a>-->
            <h5 class="fr">欢迎登陆:13049148938</h5>
        </div>
    </div>

    <div class="s-side animation-bg-color-skyblue">
        <ul>
            <!--这部分是导航栏信息。-->
            <li class="s-firstItem first">
                <a href="/user/index">
                    <i class="fa fa-home"></i>
                    <span>首页</span>
                </a>
            </li>
            <!--查找-->
            <li class="first">
                <div class="d-firstNav s-firstNav clearfix">
                    <i class="fa fa-bars"></i>
                    <span>查找</span>
                    <i class="fa fa-caret-right fr"></i>
                </div>
                <ul class="d-firstDrop s-firstDrop">
                    <li class="s-secondItem">
                        <i class="fa fa-minus-square-o"></i>
                        <a href="/evaluate/toFindEval">
                            查找医生&nbsp;<span class="icon-cheveron-right"></span>
                        </a>
                    </li>
                </ul>
            </li>
            <!--预约挂号-->
            <li class="first">
                <div class="d-firstNav s-firstNav clearfix">
                    <i class="fa fa-bars"></i>
                    <span>预约挂号</span>
                    <i class="fa fa-caret-right fr"></i>
                </div>
                <ul class="d-firstDrop s-firstDrop">
                    <li class="s-secondItem">
                        <i class="fa fa-minus-square-o"></i>
                        <a href="/reservation/toReserve">
                            预约&nbsp;<span class="icon-cheveron-right"></span>
                        </a>
                    </li>
                </ul>
            </li>

            <!--社区-->
            <li class="first">
                <div class="d-firstNav s-firstNav">
                    <i class="fa fa-bars"></i>
                    <span>社区</span>
                    <i class="fa fa-caret-right fr" ></i>
                </div>
                <ul class="d-firstDrop s-firstDrop">
                    <li>
                        <div class="d-secondNav s-secondNav">
                            <i class="fa fa-minus-square-o"></i>
                            <span>文章</span>
                            <i class="fa fa-caret-right fr"></i>
                        </div>
                        <ul class="d-secondDrop s-secondDrop">
                            <li class="s-thirdItem">
                                <a href="/community/toSendArticle">
                                    发表文章&nbsp;<span class="icon-cheveron-right"></span>
                                </a>
                            </li>
                            <li class="s-thirdItem">
                                <a href="/community/showArticle">
                                    浏览文章&nbsp;<span class="icon-cheveron-right"></span>
                                </a>
                            </li>
                        </ul>
                    </li>
                    <li>
                        <div class="d-secondNav s-secondNav">
                            <i class="fa fa-minus-square-o"></i>
                            <span>帖子</span>
                            <i class="fa fa-caret-right fr "></i>
                        </div>
                        <ul class="d-secondDrop s-secondDrop">
                            <li class="s-thirdItem">
                                <a href="/community/toCommunity">
                                    浏览帖子&nbsp;<span class="icon-cheveron-right"></span>
                                </a>
                            </li>
                        </ul>
                    </li>
                </ul>
            </li>
            <!--个人中心-->
            <li class="first">
                <div class="d-firstNav s-firstNav clearfix">
                    <i class="fa fa-bars"></i>
                    <span>个人中心</span>
                    <i class="fa fa-caret-right fr"></i>
                </div>
                <ul class="d-firstDrop s-firstDrop">
                    <li>
                        <div class="d-secondNav s-secondNav">
                            <i class="fa fa-minus-square-o"></i>
                            <span>个人资料</span>
                            <i class="fa fa-caret-right fr"></i>
                        </div>
                        <ul class="d-secondDrop s-secondDrop">
                            <li class="s-thirdItem">
                                <a href="/user/userInfo">
                                    个人信息&nbsp;<span class="icon-cheveron-right"></span>
                                </a>
                            </li>
                            <li class="s-thirdItem">
                                <a href="/user/password">
                                    修改密码&nbsp;<span class="icon-cheveron-right"></span>
                                </a>
                            </li>
                            <li class="s-thirdItem">
                                <a href="/user/verify">
                                    实名认证&nbsp;<span class="icon-cheveron-right"></span>
                                </a>
                            </li>
                        </ul>
                    </li>
                    <li>
                        <div class="d-secondNav s-secondNav">
                            <i class="fa fa-minus-square-o"></i>
                            <span>钱包</span>
                            <i class="fa fa-caret-right fr"></i>
                        </div>
                        <ul class="d-secondDrop s-secondDrop">
                            <li class="s-thirdItem">
                                <a href="/reservation/toWallet">
                                    我的钱包&nbsp;<span class="icon-cheveron-right"></span>
                                </a>
                            </li>
                            <li class="s-thirdItem">
                                <a href="/reservation/toRecharge">
                                    充值&nbsp;<span class="icon-cheveron-right"></span>
                                </a>
                            </li>
                            <li class="s-thirdItem">
                                <a href="/reservation/toBill">
                                    我的账单&nbsp;<span class="icon-cheveron-right"></span>
                                </a>
                            </li>
                        </ul>
                    </li>
                    <li class="s-secondItem">
                        <i class="fa fa-minus-square-o"></i>
                        <a href="/community/toCollection">
                            我的收藏&nbsp;<span class="icon-cheveron-right"></span>
                        </a>
                    </li>
                    <li class="s-secondItem">
                        <i class="fa fa-minus-square-o"></i>
                        <a href="/evaluate/toMyEvaluate">
                            我的评价&nbsp;<span class="icon-cheveron-right"></span>
                        </a>
                    </li>

                </ul>
            </li>
        </ul>
    </div>
</div>
<div class="layout">
    <div class="container">
        <!--评价 tab start-->
        <ul id="myTab" class="nav nav-tabs" role="tablist">
            <!--已评价 tab-->
            <li class="nav-item">
                <a id="isEvaluate-tab" class="nav-link active" data-toggle="tab" href="#isEvaluate" role="tab" aria-controls="isEvaluate" aria-selected="true">已评价</a>
            </li>
            <!--待评价 tab-->
            <li class="nav-item">
                <a id="waitEvaluate-tab" class="nav-link" data-toggle="tab" href="#waitEvaluate" role="tab" aria-controls="waitEvaluate" aria-selected="true">待评价</a>
            </li>
        </ul>
        <!--<ul id="myTab" class="nav nav-tabs">-->
        <!--&lt;!&ndash;已评价模块&ndash;&gt;-->
        <!--<li class="active">-->
        <!--<a href="#isEvaluate" data-toggle="tab">已评价</a>-->
        <!--</li>-->
        <!--&lt;!&ndash;待评价模块&ndash;&gt;-->
        <!--<li id="we">-->
        <!--<a href="#waitEvaluate"  data-toggle="tab">待评价</a>-->
        <!--</li>-->
        <!--</ul>-->
        <!--评价 tab end-->

        <!--评价 content start-->
        <div id="myTabContent" class="tab-content">
            <!--已评价 content-->
            <div id="isEvaluate" class="tab-pane fade show active " role="tabpanel" aria-labelledby="isEvaluate-tab">
                <!--利用a标签进行循环处理-->

                <a th:each="myEvaled : ${pageInfo.getContent()}" >
                    <a href="#" style="display:none;" th:class="aTip+${myEvaled.id}"></a>
                    <!--普通-->
                    <div class="evaluate card" >
                        <div th:class="${myEvaled.id}">
                            <div class="card-header">
                                <span class="icon-pencil"></span>我的评价
                                <span class="evaluate-time">[[${#dates.format(myEvaled.evaluateTime, 'yyyy-MM-dd hh:mm:ss')}]]</span>
                            </div>
                            <div class="card-body">
                                <table>
                                    <tr class="tab-info-tr">
                                        <th>评价医生:</th>
                                        <td>[[${myEvaled.doctorName}]]</td>
                                    </tr>
                                    <!--废弃-->
                                    <!--<tr class="tab-info-tr">-->
                                    <!--<th>评价时间:</th>-->
                                    <!--&lt;!&ndash;[[${myEvaled.evaluateTime}]]&ndash;&gt;-->
                                    <!--<td></td>-->
                                    <!--</tr>-->
                                    <tr class="tab-info-tr">
                                        <th>评价等级:</th>
                                        <td th:class="tableBox+${myEvaled.id}">
                                            <!--<span>[[${myEvaled.level}]]</span>-->
                                            <!--starShow()插入目标★★★★★-->
                                        </td>
                                        <!--执行starShow()---------------处理星星显示问题--------->
                                        <script type="text/javascript">
                                            function starShow() {
                                                var num  =[[${myEvaled.level}]];
                                                var eid  = [[${myEvaled.id}]];
                                                // 添加带有eid的<div>
                                                var addit = "<div class='star_list"+" "+"box"+eid+"'>"+"</div>";
                                                // 根据eid添加对应的star
                                                $(".tableBox"+eid).append(addit);
                                                // 添加实心星星
                                                for (var i= 1; i<=num; i++) {
                                                    $(".box"+eid).append( "<a href='#' class='star"+i+"'>★</a>");
                                                    $(".box"+eid+" "+".star"+i).css("color","red");
                                                    // $(".box"+eid+" "+".star"+i).addClass("star-empty icon-star-full");//添加实心星星样式
                                                }
                                                // 添加空心星星
                                                for(var a=num+1;a<=5;a++ )
                                                {
                                                    $(".box"+eid).append( "<a href='#' class='star"+a+"'>★</a>");
                                                    $(".box"+eid+" "+".star"+a).css("color","lightgray");
                                                    // $(".box"+eid+" "+".star"+a).addClass("star-full icon-star-full");
                                                }
                                                return -1;
                                            }
                                            starShow();
                                        </script>
                                </tr>
                                <!--&lt;!&ndash;评价内容&ndash;&gt;-->
                                <!--<tr class="tab-info-tr">-->
                                    <!--<th>评价内容:</th>-->
                                    <!--<td>评价内容</td>-->
                                    <!--</tr>-->
                                    <!--&lt;!&ndash;追评时间&ndash;&gt;-->
                                    <!--<tr class="tab-info-tr">-->
                                    <!--<td class="addCom" colspan="2"><small>用户1天后追评</small></td>-->
                                <!--</tr>-->
                                <!--&lt;!&ndash;追平内容&ndash;&gt;-->
                                <!--<tr class="tab-info-tr">-->
                                    <!--<th>追评内容:</th>-->
                                    <!--<td></td>-->
                                <!--</tr>-->
                            </table>
                            <!--success-btn 为绿色按钮
                                warn-btn  为黄色按钮
                                danger-btn 为红色按钮-->
                            <!--&lt;!&ndash;没有追评&ndash;&gt;-->
                             <!--<div id="1">-->
                                 <!--<input class="input-btn btn success-btn" type="button" value="追评" onclick="addEval(divclass);">-->
                                 <!--<input class="input-btn btn danger-btn" type="button" value="删除">-->
                             <!--</div>-->
                            <!--&lt;!&ndash;点击追评&ndash;&gt;-->
                             <!--<div class="2">-->
                                 <!--<textarea class="textarea_2"></textarea>-->
                                 <!--<input class="input-btn btn success-btn" value="发布" type="button" id="id">-->
                                 <!--<input class="input-btn btn warn-btn" value="取消" type="button" onclick="recover(id);">-->
                             <!--</div>-->
                            <!--&lt;!&ndash;发布追平后&ndash;&gt;-->
                             <!--<div id="3">-->
                                 <!--<input class="input-btn btn danger-btn" type="button" value="删除">-->
                                 <!--<div class="clearfix"></div>-->
                             <!--</div>-->

                            <!--添加js处理数据-->
                            <script type="text/javascript">
                                function f() {
                                    var content1 = "";
                                    // console.log([[${pageInfo.getContent()}]]);
                                    // console.log([[${myEvaled.evaluateTime}]]);
                                    content1 = '[[${myEvaled.content}]]';
                                    var divclass = [[${myEvaled.id}]];
                                    var front = content1.split('%#%')[0];

                                    var later = "[[${myEvaled.addContent}]]";//later（追平内容）状态
                                    var isEval = [[${myEvaled.isEvalTwice}]];//isEval（追评）状态

                                        //用于判断追加的内容
                                        // ---------------------评价内容 无需修改---------------------
                                        var EvalContent = "<tr class='tab-info-tr'>";
                                        EvalContent += "<th>评价内容:</th>";
                                        EvalContent += "<td name='content' id='e_front'>";
                                        EvalContent += front;
                                        EvalContent += "</td></tr>";
                                        $("." + divclass + " " + ".card-body table").append(EvalContent);
                                        // 拼接效果
                                        // <tr class='tab-info-tr'>
                                        //     <th>评价内容:</th>
                                        //     <td name='content' id='e_front'>front</td>
                                        // </tr>

                                        //处理追评显示的操作1：时间 ，2 ：内容
                                        if (later !== null && later !== ''){
                                            var end= "[[${myEvaled.eTwiceTime}]]";
                                            var begin = "[[${myEvaled.evaluateTime}]]";
                                            if(end !== null && end !== "")
                                                var theTime =  timespace(end, begin);

                                            // 添加追评和追平内容
                                            // ---------------------追评时间 已修改---------------------
                                            var addTime = "<tr class='tab-info-tr'>";
                                            addTime += "<td class='addCom' colspan='2' name='content' id='e_front'>";
                                            addTime += "<small>" + theTime + "</small>";
                                            addTime += "</td></tr>";
                                            $("." + divclass + " " + ".card-body table").append(addTime);//时间
                                            // 拼接效果
                                            // <tr class='tab-info-tr'>
                                            //     <td class='addCom' colspan='2'><small>用户1天后追评</small></td>
                                            // </tr>

                                            // console.log("later:是什么鬼")
                                            // ---------------------追评内容 无需修改---------------------
                                            var laterEvalContent = "<tr class='tab-info-tr'>";
                                            laterEvalContent += "<th>追评内容:</th>";
                                            laterEvalContent += "<td name='content' id='e_front'>";
                                            laterEvalContent += later;
                                            laterEvalContent += "</td></tr>";
                                            $("." + divclass + " " + ".card-body table").append(laterEvalContent);//内容
                                            // 拼接效果
                                            // <tr class="tab-info-tr">
                                            //     <th>追评内容:</th>
                                            //     <td>追评内容</td>
                                            // </tr>
                                        }

                                        //处理"追加"按钮的数据拼接
                                        // 根据追评状态处理 isEval true:已追评 else:未追评

                                        if (isEval == '1' && isEval !== null){
                                            //已追评按钮组 added
                                            // ---------------------发布追平 只有一个删除按钮 已修改---------------------
                                            var added = "<div id='addEval" + divclass + "'>";
                                            added += "<input class='input-btn btn danger-btn delete_eval" + divclass + "' onclick='deleteEval( "+[[${myEvaled.id}]]+");' type='button' value='删除'>";
                                            added += "<div class='clearfix'></div></div>"; //清除浮动
                                            $("." + divclass + " " + ".card-body").append(added);//已追评
                                            // 拼接效果
                                            // <div id="3">
                                            //     <input class="input-btn btn danger-btn" type="button" onclick='deleteEval()' value="删除">
                                            //     <div class="clearfix"></div>
                                            // </div>
                                        }
                                        else{
                                            //未追评按钮组 addEeal
                                            // id为addEval-divclass的<div>
                                            // ---------------------未发布追评 有追评按钮和删除按钮 已修改---------------------
                                            var addEeal= "<div id='addEval"+divclass+"'>";
                                            addEeal += "<input class='input-btn btn success-btn' type='button' value='追评' onclick='addEval(" + divclass + ");'>";// 追评按钮，点击触发addEval(id)
                                            addEeal +="<input class='input-btn btn danger-btn delete_eval" + divclass + "' onclick='deleteEval( "+[[${myEvaled.id}]]+");' type='button' value='删除'>";
                                            addEeal +="</div>";
                                            $("." + divclass + " " + ".card-body").append(addEeal);//未追评
                                            // 拼接效果
                                            // <div id="1">
                                            //     <input class="input-btn btn success-btn" type="button" value="追评" onclick="addEval(divclass);">
                                            //     <input class="input-btn btn danger-btn" type="button" value="删除">
                                            // </div>
                                        }
                                        return -1;
                                    }
                                    f();

                                    //处理当点击“追评”的页面
                                    // ---------------------点击追评按钮后 有输入框发布、取消按钮 已修改---------------------
                                    function addEval(id) {
                                        var mycontent = "";
                                        mycontent += "<textarea class='textarea_2'></textarea>";
                                        mycontent += "<input class='input-btn btn success-btn' value='发布' type='button' id='" + id + "'>";
                                        mycontent += "<input class='input-btn btn warn-btn' value='取消' type='button' onclick='recover(" + id + ");'>";// 取消按钮，点击触发recover(id)
                                        $("#addEval"+id).html(mycontent);
                                        // 拼接效果
                                        // <textarea class="textarea_2"></textarea>
                                        // <input class="input-btn btn success-btn" value="发布" type="button" id="id">
                                        // <input class="input-btn btn warn-btn" value="取消" type="button" onclick="recover(id);">

                                        $("#"+id).click(function () {
                                            //获取textarea的值
                                            var sc = $(".textarea_2").val();
                                            var id = Number($(this).attr("id"));
                                            // console.log("我的id"+id);
                                            $.post("/evaluate/saveSecondEvaluate",{cid :id,content : sc},function (Evaluate) {
                                                console.log("sc:"+sc);
                                                if (sc !== "") {

                                                    //设置时间显示格式
                                                    var sdf = Evaluate.eTwiceTime;
                                                    // console.log("endTime:"+sdf)
                                                    var btime = Evaluate.evaluateTime;
                                                    // console.log("stattime:"+btime);
                                                    var theTime = timespace(sdf,btime);

                                                    // 添加追评和追平内容
                                                    // ---------------------发布追评内容后的追评时间 已修改---------------------
                                                    var addTime = "<tr class='tab-info-tr'>";
                                                    addTime += "<td class='addCom' colspan='2' name='content' id='e_front'>";
                                                    addTime += "<small>" + theTime + "</small>";
                                                    addTime += "</td></tr>";
                                                    $("." + id + " " + ".card-body table").append(addTime);//时间
                                                    // 拼接效果
                                                    // <tr class="tab-info-tr">
                                                    //     <td class="addCom" colspan="2"><small>用户1天后追评</small></td>
                                                    // </tr>

                                                    // ---------------------发布追评内容后的追评内容 无需修改---------------------
                                                    var laterEvalContent = "<tr class='tab-info-tr'>";
                                                    laterEvalContent += "<th>追评内容:</th>";
                                                    laterEvalContent += "<td name='content' id='e_front'>";
                                                    laterEvalContent += Evaluate.addContent;
                                                    laterEvalContent += "</td></tr>";
                                                    $("." + id + " " + ".card-body table").append(laterEvalContent);//内容
                                                    //拼接效果
                                                    // <tr class="tab-info-tr">
                                                    //     <th>追评内容:</th>
                                                    //     <td>追评内容追评内容</td>
                                                    // </tr>

                                                    // 移除输入框以及按钮组
                                                    $("#addEval"+id).remove();

                                                    //添加删除按钮
                                                    // ---------------------发布追评内容后 只有删除按钮 已修改---------------------
                                                    var added = "<div id='addEval" + id + "'>";
                                                    added += "<input class='input-btn btn danger-btn delete_eval" + id + "' onclick='deleteEval( " + [[${myEvaled.id}]] + ");' type='button' value='删除'>";
                                                    added += "<div class='clearfix'></div>";// 清除浮动
                                                    $("." + id + " " + ".card-body").append(added);
                                                    // <div id="3">
                                                    //     <input class="input-btn btn danger-btn" type="button" value="删除">
                                                    //     <div class="clearfix"></div>
                                                    // </div>
                                                }
                                            });
                                        });
                                    }

                                //点击“取消”恢复原始状态
                                function recover(id) {
                                    // ---------------------点击取消后 恢复追平按钮和删除按钮 已修改---------------------
                                    $("#addEval"+id).remove();
                                    var addEeal= "<div id='addEval"+id+"'>";
                                    addEeal += "<input class='input-btn btn success-btn' type='button' value='追评' onclick='addEval(" + id + ")';>";
                                    // ------删除1------
                                    addEeal +="<input type='button' value='删除' class='delete_eval" + id + " "+"input-btn btn danger-btn "+"' onclick='deleteEval(" + [[${myEvaled.id}]] + ")'; />";
                                    addEeal +="</div>"
                                    // $("#addEval" + id).html(addEeal);
                                    $("." + id + " " + ".card-body").append(addEeal);
                                    // 拼接效果
                                    // <div id="1">
                                    //     <input class="input-btn btn success-btn" type="button" value="追评" onclick="addEval(divclass);">
                                    //     <input class="input-btn btn danger-btn" type="button" value="删除">
                                    // </div>
                                }

                                    //处理两个时间的时间间隔
                                    function timespace(endtime,starttime) {
                                        //时间显示上的处理：------------------------time--------------------------------------------------
                                        var startTime = starttime.replace(/-/g,"/");
                                        console.log("t_start="+startTime);
                                        var s = new Date(startTime);

                                        var endTime = endtime.replace(/-/g,"/");
                                        var e = new Date(endTime);
                                        console.log("t_endtime="+e);
                                        var days="";
                                        var num = (e-s)/(1000*3600*24);//计算出天数，取整数处理
                                        console.log("天数:"+num);
                                        //如果时间小于一天，则num=0,
                                        if(num<1){
                                            days = "用户当天追加评价"
                                        }
                                        else{
                                            //时间刚好一天，或者更多，则算第二天
                                            var time= parseInt(Math.ceil(num));//有余数进位加一
                                            days = "用户"+time+"天后追加评价";
                                        }
                                        console.log("days="+days);
                                        return days;
                                    }

                                    function getid(){
                                        var evalid = [[${myEvaled.id}]];
                                        return evalid;
                                    }

                                    //删除测试:设置a的href然后主动激活a标签
                                    function deleteEval(tid) {
                                        var nowPage =parseInt($(".nowPage").text());//现在的页数
                                        var totalPage =parseInt($(".totalPage").text());//所有的页数
                                        var itemNum = parseInt($(".itemNum").text());//所有的内容个数
                                        // $("."+getid()).append("<a th:href='' class='aa"+getid()+"'></a>");
                                        console.log(nowPage);
                                        console.log(totalPage);
                                        console.log(itemNum);
                                        var uuid = [[${uid}]];
                                        //----------------------------------------------------------------------用户id
                                        console.log(uuid);
                                        $.post("/evaluate/deleteEvaluate",{np:nowPage,tp:totalPage,in:itemNum,itemId:tid,uid:uuid},function(String){
                                            var a = ".aTip"+tid;
                                            $(a).attr("href",String);
                                            console.log(a+String);
                                            $(a)[0].click();
                                        });
                                        // this.location.href = String;
                                        // console.log(host)
                                        // console.log("path:"+host+String);
                                        // window.location.href=host+String  rel="external nofollow";
                                    }
                                </script>
                            </div>
                        </div>
                    </div>
                </a>

                <!--页码 start-->
                <!--加入js处理-->
                <div class="pagination-box isEvalpanel">
                    <script>
                        function  addpanel() {
                            var pageNum = [[${pageInfo.totalElements}]];
                            var pageMsg = "";

                            if([[${pageInfo.hasPrevious()}]]){
                                pageMsg+="<a class='a-btn animation' href='/evaluate/toMyEvaluate?pn=0&id="+[[${uid}]]+"'>首页</a>";
                                pageMsg+="<a class='a-btn animation' href='/evaluate/toMyEvaluate?pn="+[[${pageInfo.getNumber()}-1]]+"&id="+[[${uid}]]+"'>上一页</a>";
                            }
                            else{
                                pageMsg+=" <a class='a-btn-active animation' href='#'>首页</a>";
                                pageMsg+="<a class='a-btn-active animation' href='#'>上一页</a>";
                            }
                            // pageMsg+="  <div class='page-number'>";
                            // pageMsg+=" <th:block th:each='i : ${#numbers.sequence(1,pageInfo.totalPages)}'>";
                            // pageMsg+="<a class='a-btn animation' href='/evaluate/toMyEvaluate?pn =${i}-1,id=${uid}'><th:block th:text='${i}'></th:block></a>";
                            // pageMsg+=" </th:block>";
                            // pageMsg+="  </div>";
                            if ([[${pageInfo.hasNext()}]]){
                                pageMsg+="<a class='a-btn animation' href='/evaluate/toMyEvaluate?pn="+[[${pageInfo.getNumber()}+1]]+"&id="+[[${uid}]]+"'>下一页</a>";
                                pageMsg+="<a class='a-btn animation' href='/evaluate/toMyEvaluate?pn="+[[${pageInfo.totalPages}-1]]+"&id="+[[${uid}]]+"'>尾页</a>"
                            } else {
                                pageMsg+="<a class='a-btn-active animation' href='#'>下一页</a>";
                                pageMsg+="<a class='a-btn-active animation' href='#'>尾页</a>"
                                // pageMsg+="  <a class='a-btn-active animation' th:href='@{/evaluate/toMyEvaluate(pn = ${pageInfo.totalPages}-1,id=${uid})}'>下一页</a>";
                                // pageMsg+="<a class='a-btn-active animation' th:href='@{/evaluate/toMyEvaluate(pn = ${pageInfo.totalPages}-1,id=${uid})}'>尾页</a>"
                            }

                            // if([[${pageInfo.hasPrevious()}]]){
                            // pageMsg+="<a class='a-btn animation' th:href='@{/evaluate/toMyEvaluate(pn=0,id=${uid})}'>首页</a>";
                            // pageMsg+="<a class='a-btn animation' th:href='@{/evaluate/toMyEvaluate(pn = ${pageInfo.getNumber() }- 1,id=${uid})}'>上一页</a>";
                            // }
                            // else{
                            //     pageMsg+=" <a class='a-btn-active animation' th:href='@{/evaluate/toMyEvaluate(pn=0,id=${uid})}'>首页</a>";
                            //     pageMsg+="    <a class='a-btn-active animation' th:href='@{/evaluate/toMyEvaluate(pn = ${pageInfo.hasPrevious()} ? ${pageInfo.getNumber() } - 1 : 0,id=${uid})}'>上一页</a>";
                            // }
                            // pageMsg+="  <div class='page-number'>";
                            // pageMsg+=" <th:block th:each='i : ${#numbers.sequence(1,pageInfo.totalPages)}'>";
                            // pageMsg+="<a class='a-btn animation' th:href='@{/evaluate/toMyEvaluate(pn =${i}-1,id=${uid})}'><th:block th:text='${i}'></th:block></a>";
                            // pageMsg+=" </th:block>";
                            // pageMsg+="  </div>";
                            // if ([[${pageInfo.hasNext()}]]){
                            //     pageMsg+="  <a class='a-btn animation' th:href='@{/evaluate/toMyEvaluate(pn = ${pageInfo.getNumber()} + 1,id=${uid})}'>下一页</a>";
                            //     pageMsg+="<a class='a-btn animation' th:href='@{/evaluate/toMyEvaluate(pn = ${pageInfo.totalPages}-1,id=${uid})}'>尾页</a>"
                            // } else {
                            //     pageMsg+="  <a class='a-btn-active animation' th:href='@{/evaluate/toMyEvaluate(pn = ${pageInfo.totalPages}-1,id=${uid})}'>下一页</a>";
                            //     pageMsg+="<a class='a-btn-active animation' th:href='@{/evaluate/toMyEvaluate(pn = ${pageInfo.totalPages}-1,id=${uid})}'>尾页</a>"
                            // }
                            $(".isEvalpanel").append(pageMsg);
                        }
                        addpanel();
                    </script>
                    <!--<a class="a-btn animation" th:href="@{/evaluate/toMyEvaluate(pn=0,id=${uid})}">首页</a>-->
                    <!--<a class="a-btn animation" th:href="@{/evaluate/toMyEvaluate(pn = ${pageInfo.hasPrevious()} ? ${pageInfo.getNumber() } - 1 : 0,id=${uid})}">上一页</a>-->
                    <!--<div class="page-number">-->
                    <!--<th:block th:each="i : ${#numbers.sequence(1,pageInfo.totalPages)}">-->
                    <!--<a class="a-btn animation" th:href="@{/evaluate/toMyEvaluate(pn = ${i}-1,id=${uid})}"><th:block th:text="${i}"></th:block></a>-->
                    <!--</th:block>-->
                    <!--</div>-->
                    <!--<a class="a-btn animation" th:href="@{/evaluate/toMyEvaluate(pn = ${pageInfo.hasNext()} ? ${pageInfo.getNumber()} + 1 : ${pageInfo.totalPages}-1,id=${uid} )}">下一页</a>-->
                    <!--<a class="a-btn animation" th:href="@{/evaluate/toMyEvaluate(pn = ${pageInfo.totalPages}-1,id=${uid})}">尾页</a>-->
                </div>
                <div class="page-msg">
                    <span>当前第<span class="nowPage" th:text="${pageInfo.getNumber()+1}"></span>页</span>
                    <span>总<span class="totalPage" th:text="${pageInfo.totalPages}"></span>页</span>
                    <span>共<span class="itemNum" th:text="${pageInfo.totalElements}"></span>条记录</span>
                </div>
                <!--页码 end-->
                <script>
                    function f1() {
                        var nuu= [[${pageInfo.totalElements}]];
                        if (nuu==0){
                            $("#isEvaluate").html("<div>你没有任何已评价内容</div>");
                        }
                    }
                    f1();
                </script>

            </div>
            <!--待评价 content-->
            <div id="waitEvaluate" class="tab-pane fade" role="tabpanel" aria-labelledby="waitEvaluate-tab">
                <!--插入字符串样本-->
                <!--<div class="evaluate card has-shadow">-->
                <!--<div class="card-header">-->
                <!--<span class="icon-pencil"></span>待评价-->
                <!--</div>-->
                <!--<div class="card-body">-->
                <!--<table>-->
                <!--<tr class="tab-info-tr">-->
                <!--<th>评价医生:</th>-->
                <!--<td>element.doctorName</td>-->
                <!--</tr>-->
                <!--<tr class="tab-info-tr">-->
                <!--<th>评价时间:</th>-->
                <!--<td>element.time</td>-->
                <!--</tr>-->
                <!--</table>-->
                <!--<a class="goto-evaluate-btn animation" href="#">-->
                <!--前往评价<span class="icon-arrow-right2"></span>-->
                <!--</a>-->
                <!--</div>-->
            <!--</div>-->

                <script th:inline="javascript">
                    <!--ajax处理点击事件,显示未评价的内容模块-->
                    $("#waitEvaluate").click(showpage(1));

                    function showpage(pageNum) {
                        $.ajax({
                            url : "/evaluate/findNoEval?pageNum=" + pageNum,
                            type : "POST",
                            dataType : "json",
                            success : function(data) {
                                var objs = eval(data);
                                // 取出回送的数据
                                // list代表后台发送回来的集合。
                                // info中封装了一些其他信息。
                                var list = objs[0];
                                var info = objs[1];
                                var result = "";
                                var page = "";

                                // 遍历集合 index为索引，element为对象
                                // 信息
                                if (info.dataCount==0)
                                {
                                    var re="";
                                    re +="<div class='evaluate card has-shadow'>你没有待评价内容";
                                    re +="</div>";
                                    $("#waitEvaluate").html(re);

                                }else {//else--begin
                                    $.each(list, function (index, element) {
                                        //拼接字符串
                                        result += "<div class='evaluate card has-shadow'>";
                                        result += "<div class='card-header'><span class='icon-pencil'></span>待评价</div>";
                                        result += "<div class='card-body'><table>";
                                        result += "<tr class='tab-info-tr'><th>评价医生:</th><td>" + element.doctorName + "</td></tr>";
                                        result += "<tr class='tab-info-tr'><th>预约时间:</th><td>" + element.time + "</td></tr></table>";
                                        result += "<a class='goto-evaluate-btn animation' href='/evaluate/toEvaluate?id=" + element.id + "'>";
                                        result += "前往评价<span class='icon-arrow-right2'></span></a>";
                                        result += "</div></div>";
                                    });
                                    // 处理页码
                                    page += "<div class='pagination-box'>";
                                    if (info.pageNum == 1) {
                                        // 如果当前页码为第一页，“首页”和“上一页”失效
                                        page += "<a class='a-btn-active animation' href='#'>首页</a>";
                                        page += "<a class='a-btn-active animation' href='#'>上一页</a>";
                                    } else {
                                        var up = info.pageNum - 1;
                                        page += "<a href='#' class='a-btn animation' onclick='showpage(1)'>首页</a>" +
                                            "<a href='#' class='a-btn animation'  onclick='showpage(" + up + ")' >上一页</a>"
                                    }
                                    if (info.pageNum == info.pageCount || info.pageCount == 0) {
                                        // 如果当前页码为最后一页，“下一页”和“尾页”失效
                                        page += "<a class='a-btn-active animation' href='#'>下一页</a>";
                                        page += "<a class='a-btn-active animation' href='#'>尾页</a>";
                                    }
                                    if (info.pageNum < info.pageCount) {
                                        var nex = info.pageNum + 1;
                                        page += "<a href='#' class='a-btn animation' onclick='showpage(" + nex + ")'>下一页</a>" +
                                            "<a href='#' class='a-btn animation' onclick='showpage(" + info.pageCount + ")'>尾页</a> "
                                    }
                                    page += "</div>";
                                    page += "<div class='page-msg'>";
                                    page += "<span>当前第" + info.pageNum + "页</span>";
                                    page += "<span>总" + info.pageCount + "页</span>";
                                    page += "<span>共" + info.dataCount + "条记录</span>";
                                    page += "</div>";
                                    $("#waitEvaluate").html(result);
                                    $("#waitEvaluate").append(page);

                                }//else--end


                            }
                        });
                    }
                </script>
            </div>
        </div>
        <!--评价 content end-->
    </div>
    <div class="bubbles">
        <div class="bubble"></div>
        <div class="bubble"></div>
        <div class="bubble"></div>
        <div class="bubble"></div>
        <div class="bubble"></div>
        <div class="bubble"></div>
        <div class="bubble"></div>
        <div class="bubble"></div>
        <div class="bubble"></div>
        <div class="bubble"></div>
    </div>
</div>


</body>
</html>